﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for PhanLoai
/// </summary>
public class EPhanLoai
{
    private int loaiSP;
    private string tenLoaiSP;
    private int maDanhMuc;
    public EPhanLoai()
    { }
    public EPhanLoai(int loaiSP, string tenLoaiSP, int maDanhMuc)
    {
        this.loaiSP = loaiSP;
        this.tenLoaiSP = tenLoaiSP;
        this.maDanhMuc = maDanhMuc;
    }
    public int LoaiSP
    {
        get { return this.loaiSP; }
        set
        {
            this.loaiSP = value;
        }
    }
    public string TenLoaiSP
    {
        get { return this.tenLoaiSP; }
        set { this.tenLoaiSP = value; }
    }
    public int MaDanhMuc
    {
        get { return this.maDanhMuc; }
        set
        {
            if (value == null)
                throw new Exception("maDanhMuc not allow nullvalue.");
            this.maDanhMuc = value;
        }
    }
    public override string ToString()
    {
        return this.loaiSP + "; " + this.tenLoaiSP + "; " + this.maDanhMuc + "; ";
    }
    public override bool Equals(Object obj)
    {
        EPhanLoai me = (EPhanLoai)obj;
        bool ret = this.LoaiSP.Equals(me.LoaiSP);
        return ret;
    }
    public override int GetHashCode()
    {
        return this.LoaiSP.GetHashCode();
    }

}